package com.schoolai.schoolworkflow.controller;

/**
 * Copyright(C),2019-2025，XX公司
 * FileName:ShoolWorkFlow
 * Author:bobby
 * 创建时间：2025/9/28 10:29
 * Description:学校工作流
 * History:
 * <auth>        <time>       <version>       <desc>
 * 作者          修改时间       版本号         描述
 */

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.schoolai.util.base.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.HistoryService;
import org.flowable.engine.IdentityService;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RequestMapping("/ShoolWorkFlow")
@Tag(name = "工作流管理", description = "工作流管理")
@RestController
public class ShoolWorkFlow {
    @Resource
    private RuntimeService runtimeService;

    @Operation(summary = "听力训练工作流")
    @ApiOperationSupport(order = 1)
    @GetMapping("/ListeningTraining")
    Result ListeningTraining(){
        log.info("听力训练工作流开始");
        //启动流程变量
        String key="Process_ListeningTraining";
        ProcessInstance processInstanceByKey = runtimeService.startProcessInstanceByKey(key);
        return Result.ok("听力训练工作流开始");
    }
}
